<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
    <title>微信绑定</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        body {
            background-color: #F5F5F5;
        }

        .logo {
            width: 100%;
            height: 8%;
            line-height: 50px;
            font-weight: 700;
            text-align: center;
            background-color: white;
        }

        .form-content {
            margin-top: 10px;
            padding: 1%;
            background-color: white;
        }

        .balance {
            background-color: white;
        }
    </style>
</head>
<body>
<div class="logo">
    教职工餐补系统
</div>
@if(!isset($id))

    <form method="post" action="/binding" class="form-content">
        @csrf
        <input type="text" class="form-control" name="weixin_id" value="{{$weixin_id}}" hidden>
        <div class="form-group">
            <label for="username">工号:</label>
            <input type="text" class="form-control" name="username" id="username" placeholder="请输入工号">
        </div>
        <div class="form-group">
            <label for="pwd">密码:</label>
            <input type="password" class="form-control" name="password" id="pwd" placeholder="请输入密码">
        </div>
        <button type="submit" class="btn btn-primary">绑定</button>
    </form>
@else
    <div class="balance form-content">
        <p>
            <span style="width: 40%;padding: 2%">工号:</span>|
            <span style="width: 60%">{{$username}}</span>
        </p><p>
            <span style="width: 40%;padding: 2%">姓名:</span>|
            <span style="width: 60%">{{$first_name}}</span>
        </p><p>
            <span style="width: 40%;padding: 2%">余额:</span>|
            <span style="width: 60%">{{$meal_supplement_balance['meal_supplement_balance']}}</span>
        </p>

    </div>

@endif
@if(count($errors) > 0)
    <div class="alert alert-danger">
        <ul style="color:red;">
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
</body>
</html>
